<?php

namespace app\index\service;

use app\index\model\UM as UM;
use ShidianUtil\Exception\DataNotExistException;
use app\index\dao\AccountTokenPlanDao;
use app\common\model\AccountTokenPlan;
use think\Collection;

/**
 * Class TokenPlanService
 * @package app\index\service
 */
class TokenPlanService
{
    // dao
    private AccountTokenPlanDao $accountTokenPlanDao;

    public function __construct(AccountTokenPlanDao $accountTokenPlanDao)
    {
        $this->accountTokenPlanDao = $accountTokenPlanDao;
    }

    public function readOfH5(){
        // 查询出H5的新人套餐
        $id = 15;
        return $this->accountTokenPlanDao->find($id);
    }

    /**
     * 代币充值套餐 列表
     * @return Collection
     */
    public function index( $planType): Collection
    {
        //这里如果要修改查询，建议把查询放到dao层去
        return $this->accountTokenPlanDao->select($planType);
    }

}
